<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      /*
         try{
             //可能出错的代码
         }catch(error){
             //error就是相应的错误信息
             //如果出错了就执行这里
         }        
        */
      let a = 1
      try {
        window.console.log(b)
      } catch (error) {
        window.console.log(error)
      }
      window.console.log(a)
    </script>
  </body>
</html>
